﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SQLCE.Data;
using Autofac;

namespace SQLCE.Service
{
    public abstract class ServiceBase
    {
        public ServiceBase()
        { }
        protected IRepository<T> LoadRepository<T>() where T : class
        {
            var builder = new ContainerBuilder();
            builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();
            IContainer container = builder.Build();
            return container.Resolve<IRepository<T>>();
        }

    }
}